package example;

/**
 * 鸡蛋类
 * 具体的装饰者角色
 */
public class Egg extends  Detractor {
    /**
     *
     * @param price
     * @param desc
     * @param fastFood 具体要被装饰的对象
     */
    public Egg(double price, String desc, FastFood fastFood) {
        super(price, desc, fastFood);
    }

    @Override
    public double cost() {
        return super.getPrice()+getFastFood().cost();
    }

    @Override
    public String getDesc() {
        return getFastFood().getDesc()+"加"+super.getDesc();
    }
}
